/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package stm_database;

import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;


/**
 *
 * @author Honza
 */
public class Stm_database {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        Database d = null;
        if(args.length > 1)
        {
            try
            {
                d = new Database(args[1]);
            }catch(BadFileFormatException e)
            {
                System.out.println(e.getMessage());
            }catch(IOException e)
            {
                System.out.println(e.getMessage());
            }
        }else
        {
            d = new Database();
        }
        DatabaseController dc = new DatabaseController(d);
        dc.start(new BufferedReader(new InputStreamReader(System.in)), System.out);        
        
    }
}
